import axios from '@/utils/request.js'


//用户信息
export const api_articles = (params) => {
    return axios({
        url: `/mp/v1_0/articles`,
        method: 'GET',
        params:params
    });
}
//获取文章频道

export const api_channels = () => {
    return axios({
        url: `/mp/v1_0/channels`,
        method: 'GET',
    });
}

//删除文章
export const api_delArticles = (id) => {
    return axios({
        url: `/mp/v1_0/articles/${id}`,
        method: 'DELETE',
    });
}


//添加文章
export const api_addArticles = (params,data) => {
    return axios({
        url: `/mp/v1_0/articles`,
        method: 'POST',
        params:params,//接受query参数
        data:data,//接受body参数
    });
}




//获取指定文章
export const api_getByIdArticles = (id) => {
    return axios({
        url: `/mp/v1_0/articles/${id}`,
        method: 'GET',
    });
}
//编辑文章
export const api_putArticles = (id,params,data) => {
    return axios({
        url: `/mp/v1_0/articles/${id}`,
        method: 'PUT',
        params,//接受query参数
        data,//接受body参数
    });
}
